﻿using ConfExpert.Araclar;
using ConfExpert.Forms;
using ConfExpert.Forms.Aksesuar;
using ConfExpert.Forms.Araclar;
using ConfExpert.Forms.Depo;
using ConfExpert.Forms.Depo.Aksesuar;
using ConfExpert.Forms.Depo.CekmeTesti;
using ConfExpert.Forms.Depo.Cikis;
using ConfExpert.Forms.Depo.CycleCounting;
using ConfExpert.Forms.Depo.DonenRFID;
using ConfExpert.Forms.Depo.Kargo;
using ConfExpert.Forms.Depo.OverProduction;
using ConfExpert.Forms.Destex;
using ConfExpert.Forms.Destex.Satis;
using ConfExpert.Forms.Du4;
using ConfExpert.Forms.Espresso;
using ConfExpert.Forms.HR;
using ConfExpert.Forms.ImportWizards.Kargo;
using ConfExpert.Forms.Ithalat;
using ConfExpert.Forms.Kalite;
using ConfExpert.Forms.Lojistik;
using ConfExpert.Forms.Planlama;
using ConfExpert.Forms.Rapor.YeniYapi;
using ConfExpert.Forms.Raporlar;
using ConfExpert.Forms.Satinalma;
using ConfExpert.Forms.SatinAlma;
using ConfExpert.Forms.SatinAlma.YeniYapi;
using ConfExpert.Forms.SatinAlma.YeniYapi.Confirmation;
using ConfExpert.Forms.Siparisler;
using ConfExpert.Forms.Sistem;
using ConfExpert.Forms.Teknik;
using ConfExpert.Forms.Test;
using ConfExpert.Properties;
using DevExpress.XtraBars;
using DevExpress.XtraBars.Ribbon;
using DevTeam;
using System;
using System.Data;
using System.Drawing;

namespace ConfExpert.Utility.Ribbon
{
    public class ConfExpertRibbon
    {
        public static int[] TeamLeaders = new int[] { 3, 16, 22, 26, 7, 13, 11 };

        public class Departman
        {
            public const int KumasDepo = 6;
            public const int AksesuarSatinalma = 2;
        }

        public static RibbonManager rm;
        public static void Init()
        {
            RibbonControl RibbonControl = AppSession.MainForm.Ribbon;
            Session.RibbonControl = AppSession.MainForm.Ribbon;
            RibbonControl.Pages.Clear();
            Image newIcon = Resources.promotion;
            Image listIcon = Resources.TableHS;

            rm = new DevTeam.RibbonManager(RibbonControl);
            rm.MenuClicked += RibbonManager_MenuClicked;
            RibbonManager.Page page;
            RibbonManager.Group group;
            RibbonManager.Menu menu;
            RibbonManager.SubMenu subMenu;

            #region Ana Sayfa
            page = rm.AddPage(RibbonControl, "Ana Sayfa");
            group = page.AddGroup("Araçlar");

            if (Session.CurrentUser.isDeveloper)
                group.AddMenu("Exception İnceleme", Resources.Sign_Error_icon5, typeof(ExceptionViewer));

            group.AddMenu("Döviz Kurları", Resources.US_dollar, typeof(TCMB));

            group.AddMenu("Profil Gönder", Resources.mail_send, typeof(Profil));

            group.AddMenu("Talimatlar - Eski", Resources.XtraReportsForXpf_EnlargedSmallIcon_Ag, typeof(Attachments), "Info").Hide();
            group.AddMenu("Talimatlar", Resources.XtraReportsForXpf_EnlargedSmallIcon_Ag, typeof(Talimatlar));

            menu = group.AddMenu("Refresh Lookups", Resources.refresh);
            menu.AddCustomAction(AppSession.MainForm.RefreshData);


            group.AddMenu("Müşteri Adayları", Resources.Highlight_32x32, typeof(MusteriAday)).SetVisibleFor(229);

            //            group.AddMenu("Müşteri", Resources.XtraVerticalGrid_EnlargedSmallIcon, typeof(Customer)).SetVisibleFor(47);
            menu = group.AddMenu("Müşterilerim", Resources.Reporting_GroupType_Icon, typeof(Forms.Araclar.MyCustomers)).SetVisibleFor(186);
            menu.BeginGroup();
            group.AddMenu("Sorumlu Atama", Resources.Reporting_GroupType_Icon, typeof(Takimlar)).SetVisibleFor(185);

            //group.AddMenu("AliBES", Resources.Reporting_GroupType_Icon, typeof(AliBES)); //.Hide();

            menu = group.AddMenu("DevTeam", Resources.puzzle).Hide();
            //menu.AddSubMenu("AliBES", listIcon, typeof(AliBES));
            //menu.AddSubMenu("AliDORT", listIcon, typeof(AliDORT));
            //menu.AddSubMenu("AliUC", listIcon, typeof(AliUC));
            //menu.AddSubMenu("AliIKI", listIcon, typeof(AliIKI));
            menu.AddSubMenu("Ali", listIcon, typeof(Ali));
            menu.AddSubMenu("Betül", listIcon, typeof(Betul));
            menu.AddSubMenu("Kadir", listIcon, typeof(TestKadir));
            menu.AddSubMenu("Kâsım", listIcon, typeof(KG));
            //menu.AddSubMenu("Orhan", listIcon, typeof(PhotosCheck));
            menu.AddSubMenu("Orhan", listIcon, typeof(Orhan));
            //menu = group.AddMenu("Coverage", Resources.down, typeof(Coverage));
            //menu.SetVisibleFor(17);


            menu = group.AddMenu("Pencereler", Resources.ParametersLarge);
            menu.BeginGroup();

            subMenu = menu.AddSubMenu("Diğerlerini Kapat", Resources.WatermarkLarge_16);
            subMenu.AddCustomAction(AppSession.MainForm.DigerleriniKapat);

            subMenu = menu.AddSubMenu("Hepsini Kapat", Resources.delete_16);
            subMenu.AddCustomAction(AppSession.MainForm.HepsiniKapat);

            menu = group.AddMenu("Müşteri Bazlı İşlemler", Resources.Login_Manager);
            menu.AddCustomAction(MusteriBazli);
            menu.BeginGroup();

            menu = group.AddMenu("Sezon Bazlı İşlemler", Resources.Actions_flag_red_icon);
            menu.AddCustomAction(SezonBazli);
            menu.SetVisibleFor(5);

            //menu = group.AddMenu("Üretici Bazlı İşlemler", Resources.Import);
            //menu.AddCustomAction(AppSession.MainForm.UreticiBazliIslemler);

            menu = group.AddMenu("Raporlar", Resources.report);
            menu.AddCustomAction(Raporlar);

            menu = group.AddMenu("Task List", Resources.puzzle, typeof(TaskList));
            menu.BeginGroup();
            menu = group.AddMenu("Docs", Resources.puzzle, typeof(Docs));

            /*
            menu = group.AddMenu("DynaCAD Şablon", Resources.calculator_40, typeof(Cad1));
            menu.BeginGroup();
            menu.SetVisibleFor(6);
            group.AddMenu("DynaCAD Dosya", Resources.puzzle, typeof(Cad2)).SetVisibleFor(6);
            */
            #endregion

            #region Modelhane
            page = rm.AddPage(RibbonControl, "Modelhane");
            group = page.AddGroup("Araçlar");

            group.AddMenu("Tela", Resources.BO_Product_Large, typeof(Tela));
            group.AddMenu("Teknik Çizimler", Resources.fedex_office_logo, typeof(TeknikCizimEkle));

            menu = group.AddMenu("Yıkama Talimatları", Resources.Wash_handwash_small1);
            menu.AddCustomAction(DownloadYikamaTalimatlari);
            menu.BeginGroup();
            group = page.AddGroup("Birim Metraj");

            group.AddMenu("BM İstekleri", Resources.Highlight_32x32, typeof(ConfExpert.Forms.Depo.Kauf.BMistekleri));
            group.AddMenu("BM İstekleri Yeni", Resources.Highlight_32x32, typeof(ConfExpert.Forms.Depo.Kauf.ModelhanePastalBM));

            #endregion

            #region Siparişler

            page = rm.AddPage(RibbonControl, "Siparişler");
            //group = page.AddGroup("Dönüştürme");
            //menu = group.AddMenu("Dosya Aktarımı", Resources.process_32, typeof(_Donusturme));

            group = page.AddGroup("Ayrım");
            menu = group.AddMenu("Ayrım/Rezerve Listesi", Resources.Actions_flag_red_icon);
            menu.AddSubMenu("Kumaş", listIcon, typeof(Ayrimlar), "K");
            menu.AddSubMenu("Tela", listIcon, typeof(Ayrimlar), "T");
            menu.AddSubMenu("Kumaş+Tela", listIcon, typeof(Ayrimlar), string.Empty);

            //menu.AddSubMenu("Ayrımlar", listIcon, typeof(Ayrimlar), "<A>");
            //menu.AddSubMenu("Rezerveler", listIcon, typeof(Ayrimlar), "<R>");

            group = page.AddGroup("Sipariş");
            group.AddMenu("Maliyet", Resources.calc4_32, typeof(Maliyet));

            group.AddMenu("Showroom Gömlekleri", Resources._461145912, typeof(SRGomlekleri));

            group = page.AddGroup("Diğer");
            group.AddMenu("Numune Gömlekler", Resources._461145912, typeof(GomlekNumuneEtiketi));
            //group.AddMenu("PackingList", Resources._461145912, typeof(PackingList));
            group.AddMenu("Sipariş Adedi Dağılımı", Resources.Highlight_32x32, typeof(RenkBazindaAdet));

            group.AddMenu("Talep Tipine Göre Sipariş Dağılımı", Resources.Highlight_32x32, typeof(CustomerPerf));

            menu = group.AddMenu("Sipariş Takibi", Resources.Highlight_32x32).SetVisibleFor(228);
            menu.AddSubMenu("Liste", listIcon, typeof(SiparisTakibi));
            menu.AddSubMenu("Pivot", listIcon, typeof(SiparisPivot));
            menu.AddSubMenu("Kontrol", listIcon, typeof(SiparisAdetKontrol)).Hide();
            //group.AddMenu("Sipariş Takibi", listIcon, typeof(SiparisTakip));


            #endregion

            #region Espresso
            page = rm.AddPage(RibbonControl, "Espresso");
            group = page.AddGroup("Basic");
            menu = group.AddMenu("Liste", Resources.coffee_cup, typeof(EspressoList));

            menu = group.AddMenu("Print Collection", Resources.Action_NavigationBar_32x32);
            menu.AddSubMenu("Anlatım", listIcon).AddCustomAction(DownloadAnlatim);
            menu.AddSubMenu("Fiyat listesi", listIcon).AddCustomAction(DownloadFiyatListesi);
            menu.AddSubMenu("Indigo Yıkama Reçeteleri", listIcon).AddCustomAction(DownloadYikamaReceteleri);
            /*
            menu = group.AddMenu("Refresh Lookups", Resources.refresh);
            menu.AddCustomAction(AppSession.MainForm.RefreshData);
            */
            group.AddMenu("Detay ve Maliyet", Resources.Actions_office_chart_area_stacked_icon__1_, typeof(Espresso)).SetVisibleFor(17);
            menu = group.AddMenu("Geçmiş Alımlar", Resources.promotion1, typeof(Forms.Espresso.GecmisAlimlar));
            menu = group.AddMenu("25.01.15 Tarihli Yeni Fiyatlar", Resources.BO_Sale_v92_32x32, typeof(FiyatYeni), 4);

            //menu = group.AddMenu("Fiyat Listeleri", Resources.BO_Sale_v92_32x32);
            //menu.AddSubMenu("Eski Liste", newIcon, typeof(Fiyat), "Alfabetik");
            //menu.AddSubMenu("2015 Yeni Fiyatlar", newIcon, typeof(FiyatYeni), 4);

            //menu.AddSubMenu("2012 FOB Fabric Sales Price List", newIcon, typeof(Fiyat), "2012 FOB Fabric Sales Price List");

            //menu = group.AddMenu("Fiyat Listeleri", Resources.BO_Sale_v92_32x32, typeof(Fiyat));
            //menu.SetVisibleForDepartments(Departman.KumasSatinAlma);
            //menu.SetVisibleForUsers(TeamLeaders);
            //menu.SetVisibleForUsers(7);

            menu = group.AddMenu("Tracking", Resources.Action_NavigationBar_32x32);
            menu.AddSubMenu("Espresso", listIcon, typeof(EspTracking), "E");
            menu.AddSubMenu("Espresso Plus", listIcon, typeof(EspTracking), "EP");
            menu.AddSubMenu("Karbel", listIcon, typeof(EspTracking), "K");
            menu.AddSubMenu(true, "Pre Espresso 2016", listIcon, typeof(EspTracking), "E2016");
            menu.AddSubMenu("SS17 Print Collection", listIcon, typeof(EspTracking), "PR");

            //menu = group.AddMenu("Espresso Tracking", Resources.Action_NavigationBar_32x32, typeof(EspTracking), "E");
            //menu = group.AddMenu("Espresso Plus Tracking", Resources.Action_NavigationBar_32x32, typeof(EspTracking), "EP");
            //menu = group.AddMenu("Karbel Tracking", Resources.Action_NavigationBar_32x32, typeof(EspTracking), "K");
            menu = group.AddMenu("ESP Indigo Yıkama Talimatları", Resources.Wash_handwash_small1);
            menu.AddCustomAction(DownloadESPYikamaTalimatlari);

            //menu = group.AddMenu("Performance (of articles)", Resources.Action_NavigationBar_32x32, typeof(EspPerfA));

            //menu = group.AddMenu("Performance", Resources.Action_NavigationBar_32x32, typeof(Perf));
            menu = group.AddMenu("Performance", Resources.Action_NavigationBar_32x32);
            menu.AddSubMenu("Details", listIcon, typeof(PerfArt));
            menu.AddSubMenu("by Customer", listIcon, typeof(PerfArtByCustomer));
            //TODO : ilgili form yok
            //menu = group.AddMenu("Performance (of customers)", Resources.Action_NavigationBar_32x32, typeof(EspPerfA));

            #endregion

            #region Planlama

            page = rm.AddPage(RibbonControl, "Planlama");
            group = page.AddGroup("Dosyalar");


            menu = group.AddMenu("Global Dosya", Resources.kate).SetVisibleFor(243);
            menu.AddSubMenu("Şablon", listIcon, typeof(UretimSql));
            menu.AddSubMenu("Veri", listIcon, typeof(UretimKonsolide));

            //group.AddMenu("Global dosya şablonu", Resources.kate, typeof(UretimSql)).Hide();

            group.AddMenu("Üretim Takip", Resources.kate, typeof(UretimTakip));
            group.AddMenu("Sipariş öncesi Pastal Birim Metraj", Resources.kate, typeof(PastalBM)).SetVisibleFor(223);
            group.AddMenu("Termin Bazlı Üretim", Resources.kate, typeof(TerminBazliUretim));
            group.AddMenu("Bütün Üretimler", Resources.kate, typeof(ButunUretimler)).Hide();
            group.AddMenu("Kesilen/Yüklenen Gömlek", Resources.kate, typeof(KesilenGomlekDepo)).Hide();

            //group.AddMenu("Gömlek Transferi", Resources.kate, typeof(GomlekTransferi)).Hide();


            group.AddMenu("Üretim Özet", Resources.CustomWorkTime_Icon, typeof(UretimOzet)).BeginGroup();

            menu = group.AddMenu("Birim Metraj", Resources.cetvel2);
            menu.AddSubMenu("Genel", listIcon, typeof(BM));
            menu.AddSubMenu("Müşteriye göre gruplu", listIcon, typeof(BMByCustomer));
            //group.AddMenu("Modelhane BM - Tümü", Resources.cetvel2, typeof(ModelhaneBM));     //17;

            menu = group.AddMenu("2.Kalite", Resources.notice2);
            menu.AddSubMenu("Adetler", listIcon, typeof(ConfExpert.Forms.Planlama.Kalite2));
            menu.AddSubMenu("Yüzdeli liste", listIcon, typeof(Kalite2Yeni));


            //group.AddMenu("ESKİ Birim Metraj", Resources.TimelineView32x32, typeof(_Metraj)).SetVisibleForUsers(91);

            group.AddMenu("Eksik-Fazla Kesim", Resources.notice2, typeof(KesimAdetleri));
            group.AddMenu("Müşteri bazlı EF", Resources.notice2, typeof(SiparisKesimAdet));
            group.AddMenu("Kesim Tarihleri Raporu", Resources.notice2, typeof(KesimRaporu));
            group.AddMenu("Modelhane Giriş Adetleri", Resources.Ayir_32x32, typeof(ModelhaneGunlukPerf)).SetVisibleFor(7);
            group.AddMenu("Kesilen Yüklenen", Resources.cetvel2, typeof(KesilenYuklenen));

            group.AddMenu("Dosya Metrajlarım", Resources.GanttView_32x32, typeof(PastalBirimMetrajlar)).SetVisibleFor(8);
            group.AddMenu("Üretilen Modeller", Resources.GanttView_32x32, typeof(Uretilen)).SetVisibleFor(17);
            group.AddMenu("Üretim Planlama", Resources.GanttView_32x32, typeof(UretimPlanlama)).SetVisibleFor(17);
            group.AddMenu("Üretim Planlama", Resources.GanttView_32x32, typeof(UretimPlanlama2));

            menu = group.AddMenu("Atelye Setleme", Resources.Actions_flag_green_icon).SetVisibleFor(215);
            menu.AddSubMenu("Atelyesi Boş Olan Siparişler", listIcon, typeof(AtelyesiBelirlenmemisSiparisler));
            menu.AddSubMenu("Atelyesi Değişen Siparişler", listIcon, typeof(AtelyeDegisikligi));

            menu = group.AddMenu("Atelyeler", Resources.Actions_flag_green_icon, typeof(AtelyeKapasitesi));
            //menu = group.AddMenu("Çeki Listesi", Resources.Actions_flag_green_icon, typeof(CekiListesi));

            menu = group.AddMenu("Kesilen Adetlerin Toplu Aktarımı", Resources.export_32x321, typeof(ConfExpert.Forms.ImportWizards.DikilenGomlekler));
            menu = group.AddMenu("Çeki listesinden Aktarım", Resources.export_32x321, typeof(ImportPL));
            menu.SetVisibleFor(9);
            menu.BeginGroup();

            #endregion

            #region Satınalma

            page = rm.AddPage(RibbonControl, "Satınalma");
            group = page.AddGroup("KST");

            group.AddMenu("WB Unit Prices", Resources.MenuBar_ChooseSkin_Large, typeof(_WBuprice)).SetVisibleFor(17);
            group.AddMenu("WB Customer Proformas", Resources.MenuBar_ChooseSkin_Large, typeof(_WBcust)).SetVisibleFor(17);
            group.AddMenu("WB", Resources.MenuBar_ChooseSkin_Large, typeof(_WB)).SetVisibleFor(17);

            //group.AddMenu("Yeni Talep", Resources.BO_Report_32x32, typeof(KxTalep));
            //group.AddMenu("Kesinleştirme", Resources.BO_Task_32x32, typeof(KxKesin));
            //group.AddMenu("AKTİF Siparişler", Resources.BO_Sale_v92_32x32, typeof(KSip), "A");
            group.AddMenu("KST", Resources.BO_Sale_v92_32x32, typeof(KSip));
            group.AddMenu("KST Analiz", Resources.MenuBar_ChooseSkin_Large, typeof(KstAnaliz)).Hide();

            //menu = group.AddMenu("Problemler", Resources.properties, typeof(KstProblemler));
            //menu.SetVisibleForUsers(7, 11, 14, 23, 30, 57);
            //menu.BeginGroup();

            //menu = group.AddMenu("Kontrol Onay", Resources.MenuBar_ChooseSkin_Large, typeof(KOnay));
            //menu.SetVisibleForUsers(7);

            //group.AddMenu("Dokümanlar", Resources.Action_FileAttachment_Attach_32x32, typeof(Attachments), "Dosya");
            group.AddMenu("Price Lists", Resources.attach_image, typeof(Attachments), "PriceList").SetVisibleFor(10);

            //group = page.AddGroup("Otomatik Stok");
            //menu = group.AddMenu("Otomatik Stok Girişi", Resources.truck, typeof(OtomatikStokGirisi));

            group = page.AddGroup("Yeni Yapı");


            group.AddMenu("Fason İşlem Atelyeleri", Resources.MenuBar_ChooseSkin_Large, typeof(FasonIslemAtelyeleri)).SetVisibleFor(189);


            menu = group.AddMenu("Sipariş Yönetimi", Resources.SNP_2696434_en_v1);

            menu.AddSubMenu("Yeni Talep", newIcon).AddCustomAction(YeniPO);
            menu.AddSubMenu("Siparişler", listIcon, typeof(ConfExpert.Forms.SatinAlma.YeniYapi.PO));
            menu.AddSubMenu(true, "Takip", listIcon, typeof(ConfExpert.Forms.SatinAlma.YeniYapi.SiparisTakip));
            menu.AddSubMenu("Takip Özet", listIcon, typeof(ConfExpert.Forms.SatinAlma.YeniYapi.SiparisTakip2));
            menu.AddSubMenu("Istenen/Gelen Analizi", listIcon, typeof(IstenenGelenAnalizi));
            menu.AddSubMenu("Konf./Yükleme Fiyat Farkları", listIcon, typeof(CheckPrices));


            /*
            menu = group.AddMenu("Sipariş Takip", Resources.SNP_2696434_en_v1, typeof(ConfExpert.Forms.SatinAlma.YeniYapi.SiparisTakip));

            //menu = group.AddMenu("Talep Oluşturma", Resources.Action_New_32x32, typeof(YeniPO));

            RibbonManager.Menu s = group.AddMenu("Talep Oluşturma", Resources.Action_New_32x32);
            s.AddCustomAction(YeniPO);
            menu.BeginGroup();

            menu = group.AddMenu("Sipariş Yönetimi", Resources.EditDoc, typeof(ConfExpert.Forms.SatinAlma.YeniYapi.PO));
            */
            //menu = group.AddMenu("Yükleme/Konfirmasyon", Resources.Lorry_Green);
            menu = group.AddMenu("Yükleme Yönetimi", Resources.Lorry_Green);
            menu.AddSubMenu("Beklenen Gelişler", listIcon, typeof(ConfExpert.Forms.SatinAlma.YeniYapi.HaftalikGelisler));
            menu.AddSubMenu("Beklenen Gelişler-2", listIcon, typeof(ConfExpert.Forms.SatinAlma.YeniYapi.HaftalikGelisler2));
            menu.AddSubMenu("Yükleme Özeti", listIcon, typeof(ConfExpert.Forms.SatinAlma.YeniYapi.HaftalikGelisler3));
            //menu.AddSubMenu(true, "Yeni Yükleme", newIcon, typeof(ConfExpert.Forms.SatinAlma.YeniYapi.YuklemeBase));
            menu.AddSubMenu("Konfirmasyonlar", listIcon, typeof(Konf));
            menu.AddSubMenu("Yüklemeler", listIcon, typeof(ConfExpert.Forms.SatinAlma.YeniYapi.Yuklemeler));
            //menu.AddSubMenu("Yükleme Ekle", listIcon, typeof(YuklemeEkle)).Hide();
            //menu.AddSubMenu(true, "Yeni Konfirmasyon", newIcon, typeof(ConfExpert.Forms.SatinAlma.YeniYapi.KonfirmasyonBase));  //kaldırılacak. önce screenshot'ını al!
            //menu.AddSubMenu("Konfirmasyonlar", listIcon, typeof(ConfExpert.Forms.SatinAlma.YeniYapi.Konfirmasyonlar));  //kaldırılacak

            menu.AddSubMenu(true, "İşlemler", listIcon, typeof(KonfOzet));
            menu.AddSubMenu("Düzelt-K", listIcon, typeof(DuzeltK)).Hide();
            menu.AddSubMenu("Düzelt-Y", listIcon, typeof(DuzeltY)).Hide();
            menu.AddSubMenu("Düzelt-Y2", listIcon, typeof(DuzeltY2)).Hide();
            //menu.AddSubMenu("DuplTest", listIcon, typeof(_DuplTest)).Hide();
            //menu.BeginGroup();

            menu = group.AddMenu("Çekme Testleri", Resources.cushion);
            menu.AddSubMenu("Talep - Yıkama", null, typeof(Talepler), "Yıkama");
            menu.AddSubMenu("Talep - Ütü", null, typeof(Talepler), "Ütü");
            menu.AddSubMenu(true, "Sonuçlar - Yıkama", null, typeof(Sonuclar), "Yıkama");
            menu.AddSubMenu("Sonuçlar - Ütü", null, typeof(Sonuclar), "Ütü");

            menu.BeginGroup();

            menu = group.AddMenu("Modül Planlama", Resources.properties, typeof(ToDo));

            menu = group.AddMenu("Eksik PO Bilgileri", Resources.invoice_24);
            menu.AddSubMenu("Açıklar", newIcon, typeof(ConfExpert.Forms.SatinAlma.YeniYapi.POEksikler), 1);
            menu.AddSubMenu("Kapalılar", newIcon, typeof(ConfExpert.Forms.SatinAlma.YeniYapi.POEksikler), 2);


            //if (Session.CurrentUser.UserId == 17)
            {
                DataTable dtOrtakSiparisler = Session.DataManager.ExecuteDataTable("GetOrtakSiparisler");
                if (dtOrtakSiparisler.Rows.Count > 0)
                {
                    menu = group.AddMenu("Ortak Siparişler", Resources.invoice_24);
                    //menu.AddSubMenu("Yeni", newIcon, typeof(AyrimTalep), 2064);
                    menu.BeginGroup();

                    foreach (DataRow dr in dtOrtakSiparisler.Rows)
                        menu.AddSubMenu("PO." + dr["SiparisId"].ToString() + ": " + dr["Vendor"].ToString(), null, typeof(AyrimTalep), (int)dr["SiparisId"]);
                }
            }

            menu = group.AddMenu("Tela Satınalma", Resources.BO_Sale_v92_32x32, typeof(TelaSatinAlma)).Hide();

            #endregion

            #region Depo
            page = rm.AddPage(RibbonControl, "Depo");
            group = page.AddGroup("Kumaş");

            //group.AddMenu("Kartela", Resources.add_24, typeof(Entities.Renkler)).SetVisibleForUsers(4, 17);

            group.AddMenu("Rapor boyu sıralı liste", Resources.legend, typeof(RBSirali)).SetVisibleFor(11);

            menu = group.AddMenu("Kumaş Kartı", Resources.legend);
            menu.AddSubMenu("Yalın", newIcon, typeof(StokKarti), false);
            menu.AddSubMenu("Stok metrajlarıyla", newIcon, typeof(StokKarti), true);
            menu.AddSubMenu("FabricType Update", null, typeof(UpdFabricType)).SetVisibleFor(193);
            menu.AddSubMenu(true, "Tekrar Taranacak Kumaşlar", null, typeof(TekrarTaranacaklar));
            menu.AddSubMenu("Tarama Kontrol", null, typeof(KontrolEdilecekResimler));
            menu.AddSubMenu("Uretici Kodları Listesi", listIcon, typeof(UKEdit));
            menu.AddSubMenu("Stok Düzenleme - Birinci Faz", listIcon, typeof(StokDuzenleme2));
            menu.AddSubMenu("Stok Düzenleme - İkinci Faz", listIcon, typeof(StokDuzenleme));

            menu = group.AddMenu("Kumaş Stoğu", Resources.ParametersLarge, typeof(DepoStok), "K");

            menu = group.AddMenu("Atıl Depo", Resources.WatermarkLarge2);
            menu.AddSubMenu("Son x Aydır Hareketsiz Toplar", listIcon, typeof(AtilKumas));
            menu.AddSubMenu("Atıl Olarak İşaretli Toplar", listIcon, typeof(AtilDepolar));


            menu = group.AddMenu("Arama", Resources.Search_icon);
            menu.AddSubMenu("Akıllı Kod Arama", newIcon, typeof(FuzzySearch));
            menu.AddSubMenu("Kart Açmadan Benzer Desen/Renk Arama", newIcon, typeof(BenzerKumas));

            //menu = group.AddMenu("Arama", Resources.Search_icon, typeof(FuzzySearch));
            //menu = group.AddMenu("Kart açmadan benzer kumaş arama", Resources.Search_icon, typeof(BenzerKumas));

            menu = group.AddMenu("Özellikler", Resources.refresh).SetVisibleFor(12);
            menu.AddSubMenu(true, "Kompozisyon", newIcon, typeof(AddKomp));
            menu.AddSubMenu("Kumaş hammaddesi", newIcon, typeof(Repository), "Hammadde");
            //menu.AddSubMenu("Konstruksiyon Ekle", newIcon, typeof(AddKons));
            //menu.AddSubMenu("Konstruksiyon", newIcon, typeof(Repository), "Konstruksiyon");
            menu.AddSubMenu("Kalite", newIcon, typeof(Repository), "Kalite");
            menu.AddSubMenu("Finish", newIcon, typeof(Repository), "Finish");
            menu.AddSubMenu("Desen", newIcon, typeof(Repository), "Desen");
            menu.AddSubMenu("Desen Yönü", newIcon, typeof(Repository), "DesenYonu");
            menu.AddSubMenu("Örgü", newIcon, typeof(Repository), "Orgu");
            menu.AddSubMenu("Rapor Boyu", newIcon, typeof(Repository), "RaporBoyu");
            menu.AddSubMenu("Yıkama Talimatı", newIcon, typeof(Repository), "YTalimat");
            menu.AddSubMenu("Fabric Type", newIcon, typeof(Repository), "FabricType");

            group = page.AddGroup("Tela");
            group.AddMenu("Tela Kartı", Resources.wendlertela2, typeof(Repository), "Tela");

            menu = group.AddMenu("Tela Stoğu", Resources.ParametersLarge, typeof(DepoStok), "T");

            menu = group.AddMenu("Stok Özet", Resources._1338456329_shine_14);
            menu.AddSubMenu("Liste1", listIcon, typeof(Forms.Depo.Tela.StokOzet));
            menu.AddSubMenu("Liste2", listIcon, typeof(Forms.Depo.Tela.TelaStokOzet));

            //menu = group.AddMenu("Stok Özet", Resources._1338456329_shine_14, typeof());
            //menu = group.AddMenu("Tela Stok Özet", Resources._1338456329_shine_14, typeof());
            //menu = group.AddMenu("Stok Özet", Resources._1338456329_shine_14, typeof(Forms.Depo.TelaOmur));                        

            group = page.AddGroup("Temel İşlemler");
            group.AddMenu("Sepet", Resources.Sepet_32x32, typeof(Sepet)).SetInvisibleForDepartments(Departman.KumasDepo);

            menu = group.AddMenu("Ayrım İstekleri", Resources.DateNavigatorModule_Icon);
            menu.SetInvisibleForDepartments(Departman.KumasDepo);
            menu.AddSubMenu("İsteklerim", listIcon, typeof(Istekler), false);
            menu.AddSubMenu("Onayımı Bekleyen İstekler", listIcon, typeof(Istekler), true);
            menu.AddSubMenu("Açık İsteklerin Tümü", listIcon, typeof(IsteklerTum));
            menu.AddSubMenu("İstatistik", listIcon, typeof(ConfExpert.Forms.Depo.Istek.Ozet));
            menu.AddSubMenu(true, "Onayımı Bekleyen Online İstekler", listIcon, typeof(OnlineRezerve));
            menu.AddSubMenu("Açık Online İsteklerin Tümü", listIcon, typeof(OnlineRezerveTum));

            //menu = group.AddMenu("Online Talepler", Resources.Browser_Icon);

            menu = group.AddMenu("Kontrol", Resources.ASPxGridView_EnlargedSmallIcon);
            menu.BeginGroup();

            menu.AddSubMenu("Şüpheli Fiyatlar", listIcon, typeof(SupheliFiyat)).SetVisibleFor(214);
            menu.AddSubMenu("Şüpheli Fiyatlar- Yükleme", listIcon, typeof(SupheliFiyatY)).SetVisibleFor(214);
            menu.AddSubMenu("Şüpheli Fiyatlar- Konf", listIcon, typeof(SupheliFiyatK)).SetVisibleFor(214);

            menu.AddSubMenu(true, "Müşteri Bazlı OwnerId Dağılımı", listIcon, typeof(Owners));
            menu.AddSubMenu("OwnerId'si Hatalı Toplar", listIcon, typeof(HataliOwner));
            menu.AddSubMenu("OwnerId'si Boş Toplar", listIcon, typeof(TemporaryForm));
            menu.AddSubMenu("Deposu Hatalı Toplar", listIcon, typeof(DeposuHataliTop));
            menu.AddSubMenu("ÜK/MK Hatalı Artikeller", listIcon, typeof(HataliUKMK));
            menu.AddSubMenu("Diğer Hatalar", new Bitmap(listIcon), typeof(RollStats));
            menu.AddSubMenu(true, "STler", listIcon, typeof(Stler));
            menu.AddSubMenu("ST kumaş analizi", newIcon, typeof(STArtikel)).SetVisibleFor(191);
            menu.AddSubMenu("Müşteri Kodları", listIcon, typeof(MKControl));
            menu.AddSubMenu("Üretici Kodları- Mask Kontrol", listIcon, typeof(UreticiKodlariMask)).SetVisibleFor(13);
            menu.AddSubMenu("Desene göre gruplu artikel listesi", listIcon, typeof(ProductsByDesen));
            //menu.AddSubMenu("Müşteri Kodları- birleştir", listIcon, typeof(MKMerge));

            menu = group.AddMenu("Bilgi", Resources.axes);
            menu.AddSubMenu("Owner Değiştirme", newIcon).SetVisibleFor(231).AddCustomAction(OwnerDegistir);

            menu.AddSubMenu("HL Üretim Listesi", listIcon, typeof(HLUretimListe));
            menu.AddSubMenu("HL Üretim İstatistikleri", listIcon, typeof(HLUretimOzet));
            menu.AddSubMenu("Aylık Kumaş Çıkışları", listIcon, typeof(AylikKumasCikislari));
            menu.AddSubMenu("Top Kalite Kontrol", listIcon, typeof(Forms.Depo.HataliTopBilgileri));
            menu.AddSubMenu("Az Metrajlı Stok", listIcon, typeof(AzMetrajliStok));
            menu.AddSubMenu("Kalite Kontrol Takip", listIcon, typeof(KaliteKontrolTakip));
            menu.AddSubMenu("Top Geçmişi", listIcon, typeof(RollHistory));
            menu.AddSubMenu("Top Hareketleri", listIcon, typeof(TopGecmisi));
            menu.AddSubMenu("Müşteri bazlı stok raporu", listIcon, typeof(IDLEStok));
            menu.AddSubMenu("Stok trend- Kumaş", listIcon, typeof(TrendsNew), "K");
            menu.AddSubMenu("Stok trend- Tela", listIcon, typeof(TrendsNew), "T");
            menu.AddSubMenu("Stok özeti xls", listIcon, typeof(StokOzet));
            menu.AddSubMenu(true, "Kumaş yaşları", listIcon, typeof(CustomerStockAging));

            //menu.AddSubMenu("Tüketimi az artikeller", listIcon, typeof(AzTuketim2));
            menu.AddSubMenu("Hareketsiz Artikeller", listIcon, typeof(AzTuketim));
            menu.AddSubMenu("TopAdetleri", listIcon, typeof(TopAdetleri)).SetVisibleFor(14);
            menu.AddSubMenu("Yerleşim Planı", listIcon, typeof(DepoYerlesim));
            menu.AddSubMenu("Lokasyon", listIcon, typeof(Lokasyon));
            menu.AddSubMenu("Muadil olarak ayrılmış toplar", listIcon, typeof(Muadiller));

            menu.AddSubMenu("Son bir ayın stok hareketleri", listIcon, typeof(SonBirAy));
            menu.AddSubMenu("Depo giriş çıkış", listIcon, typeof(DepoGirisCikis));
            menu.AddSubMenu("Artikellerin son depo girişleri", listIcon, typeof(SonGelisler));

            menu.AddSubMenu(true, "Günlük En Ölçümleri", listIcon, typeof(GunlukEnOlcumleri)).SetVisibleFor(15);

            menu.AddSubMenu("Geçmiş Alımlar", listIcon, typeof(GetPurchases));
            menu.AddSubMenu("Stok Alarmlarım", Resources.BO_Attention, typeof(StokAlarm));
            menu.AddSubMenu("Entities", listIcon, typeof(ConfExpert.Forms.Sistem.Entities)).SetVisibleFor(16);
            menu.AddSubMenu(true, "Bilanço", listIcon, typeof(ConfExpert.Forms.Depo.Bilanco2), "Kumas");
            //menu.AddSubMenu("Tela Bilanço", listIcon, typeof(ConfExpert.Forms.Depo.Bilanco2), "Tela");
            //menu.AddSubMenu("Aksesuar Bilanço", listIcon, typeof(ConfExpert.Forms.Depo.Bilanco2), "Aksesuar");
            //menu.AddSubMenu("Koli Bilanço", listIcon, typeof(ConfExpert.Forms.Depo.Bilanco2), "Koli");

            menu = group.AddMenu("Diğer", Resources.Highlight_32x32);
            //menu.AddSubMenu("Atıl Kumaşlar", listIcon, typeof(Atil)).SetVisibleFor(195);
            //menu.AddSubMenu("Atıl Kumaşlar - aktarım", listIcon, typeof(ImportAtil)).SetVisibleFor(17);
            menu.AddSubMenu("Eski Toplar", listIcon, typeof(EskiToplar));
            menu.AddSubMenu("Gelen ve iade edilen kumaş", listIcon, typeof(Iadeler));
            menu.AddSubMenu("Fatura Aktarımı", listIcon, typeof(ConfExpert.Forms.Araclar.InvoiceParse)).SetVisibleFor(17);
            menu.AddSubMenu("Kalite Kontrolü yapılan toplar", listIcon, typeof(ConfExpert.Forms.Depo.Kalite2));
            menu.AddSubMenu("Kalite Kontrol bekleyen toplar", listIcon, typeof(ConfExpert.Forms.Kalite.KontrolBekleyen));
            menu.AddSubMenu("Renk Kontrol", listIcon, typeof(DominantColors));
            menu.AddSubMenu("Kumaş Renk Dağılımı", listIcon, typeof(RenkDagilimi));
            //menu.AddSubMenu("TamponBolge", listIcon, typeof(TamponBolge));
            menu.AddSubMenu("Çıkan/Dönen Toplar", listIcon, typeof(GeriDonen));
            menu.AddSubMenu("Kalite Güvence", listIcon, typeof(Kontrol));
            menu.AddSubMenu("Kartela Tarama", listIcon, typeof(Forms.KartelaTarama));
            menu.AddSubMenu("Kartela Görüntüleme", listIcon, typeof(KartelaGoster));
            menu.AddSubMenu("Rapor boyları", listIcon, typeof(Forms.Depo.RaporBoyu)).SetVisibleFor(17);
            menu.AddSubMenu("Consolidate Worksheets", newIcon, typeof(ConsolidateSheets)).SetVisibleFor(17);
            menu.AddSubMenu("Barkod okuma/listeleme", listIcon, typeof(Forms.Araclar.Barkod));
            menu.AddSubMenu("Connection statistics", listIcon, typeof(WhosOnline2)).SetVisibleFor(17);
            menu.AddSubMenu("Desen Güncelleme", listIcon, typeof(UpdDesign)).SetVisibleFor(18);

            //menu.AddSubMenu("Aksesuar Girişleri", listIcon, typeof(ConfExpert.Forms.Depo.StokGirisleri), 1).SetVisibleFor(17);
            //menu.AddSubMenu("Kumaş Girişleri", listIcon, typeof(ConfExpert.Forms.Depo.StokGirisleri), 2).SetVisibleFor(17);
            //menu.AddSubMenu("Location Conflicts", listIcon, typeof(LocationConflict));
            //menu.AddSubMenu("Subset Sum", listIcon, typeof(Subset));
            //menu.AddSubMenu("Etiketlenen Top Adedi", listIcon, typeof(EtiketlenenTopAdedi));
            //menu.AddSubMenu("Etiketlenen Top Adedi", listIcon);

            menu.AddSubMenu("Aranacak Toplar", listIcon, typeof(AranacakToplar));
            //menu.AddSubMenu("Muadil kumaşlar", listIcon, typeof(Muadil));
            //menu.AddSubMenu("Top Tara", listIcon, typeof(ConfExpert.Forms.Depo.Gecici.Toplar));

            menu.AddSubMenu("Kart Düzenle", listIcon, typeof(StokKartiDuzelt)).SetVisibleFor(19);
            menu.AddSubMenu("Price7C", listIcon, typeof(Price7C)).SetVisibleFor(20);
            menu.AddSubMenu("Stok Grupları", listIcon, typeof(StokGruplari)).SetVisibleFor(21);

            menu.AddSubMenu("GPIO", listIcon, typeof(GPIO)).Hide();
            menu.AddSubMenu("Write Tags", Resources.Action_Sorting_Descending, typeof(RfidWriteEpc)).Hide();

            //menu = group.AddMenu("Sync StokKart w/ KST", Resources.refresh);
            //menu.SetVisibleFor(17);
            //menu.BeginGroup();

            //menu.AddSubMenu("KompozisyonId", listIcon, typeof(ConfExpert.Forms.Depo.SyncWKst), "KompozisyonId");
            //menu.AddSubMenu("Konstruksiyon", listIcon, typeof(ConfExpert.Forms.Depo.SyncWKst), "Konstruksiyon");
            //menu.AddSubMenu("EnGrubu", listIcon, typeof(ConfExpert.Forms.Depo.SyncWKst), "EnGrubu");
            //menu.AddSubMenu("FinishId", listIcon, typeof(ConfExpert.Forms.Depo.SyncWKst), "FinishId");

            group = page.AddGroup("Stok Hareketleri");
            //menu = group.AddMenu("Satın Alma ile Giriş", Resources.BO_Vendor_32x32);
            //menu.SetVisibleForUsers(17, 94);
            //menu.AddSubMenu("Yeni", newIcon, typeof(MalKabul));
            //menu.AddSubMenu("Liste", listIcon, typeof(MalKabuller));
            //menu = group.AddMenu("Depo Giriş Raporu", Resources.BO_Vendor_32x32);

            menu = group.AddMenu("Stok Girişleri", Resources.Default_32x32);
            menu.SetVisibleFor(22);
            menu.AddSubMenu("Manuel", newIcon, typeof(ConfExpert.Forms.Depo.StokGiris), 5).SetVisibleFor(23);
            menu.AddSubMenu("Yeni", newIcon, typeof(ConfExpert.Forms.SatinAlma.YeniYapi.BeklenenYuklemeler)).SetVisibleFor(24);
            menu.AddSubMenu("Yeni - Tela", newIcon, typeof(ConfExpert.Forms.Depo.StokGiris), 21);
            menu.AddSubMenu("Yeni - ST kumaşlar", newIcon, typeof(ParcaGirisi));
            menu.AddSubMenu("Otomatik Stok Girişi (TOG)", newIcon, typeof(OtomatikStokGirisi));
            menu.AddSubMenu("Etiketlenmeyen Toplar", listIcon, typeof(EtiketlenmeyenToplar));
            menu.AddSubMenu("Liste - Kumaş", listIcon, typeof(Forms.Depo.Liste1), 4);
            menu.AddSubMenu("Liste - Tela", listIcon, typeof(Forms.Depo.Liste1), 21);
            menu.AddSubMenu("Hatalı Toplar", listIcon, typeof(Forms.Depo.HatalıToplar));
            menu.AddSubMenu("Kalite Kontrol", listIcon, typeof(Forms.Depo.Liste1P));
            //menu.AddSubMenu("Yükleme bazlı etiketlenmeyen top listesi", listIcon, typeof());   

            menu = group.AddMenu("Çıkış Emirleri", Resources.Actions_flag_red_icon);
            menu.AddSubMenu("Liste", listIcon, typeof(CikisEmirleri));
            menu.AddSubMenu("Liste - Parça Çıkışları", listIcon, typeof(ParcaCikisEmirleri));
            menu.AddSubMenu("Çıkış İrsaliyeleri", listIcon, typeof(KumasCikisIrsaliye));
            menu.AddSubMenu("Kumaş Kabul", listIcon, typeof(KumasKabul));
            menu.AddSubMenu(true, "Satışlar", listIcon, typeof(CikisEmriSatis));
            menu.AddSubMenu("Satışlar- İrsaliye Bazlı", listIcon, typeof(CikisEmriSatisByIrsaliye));

            menu = group.AddMenu("Depo Taşınma", Resources.Truck_Yellow).SetVisibleFor(24);
            //menu.AddSubMenu("Kumaş Çıkışı", newIcon, typeof(ConfExpert.Forms.Depo.Tasinma.Cikis));
            //menu.AddSubMenu("Çıkış", newIcon, typeof(ConfExpert.Forms.Depo.Tasinma.RafBazliCikis));
            menu.AddSubMenu("Giriş", listIcon, typeof(ConfExpert.Forms.Depo.Tasinma.Giris));
            menu.AddSubMenu("Eski-Yeni Raflar", listIcon, typeof(TasinmadanSonra));

            group.AddMenu("Top Bölme Talepleri", Resources.puzzle, typeof(TopBolmeDepo));
            group.AddMenu("Kapıdan Çıkış", Resources.door_in_icon, typeof(CikisFormu));

            menu = group.AddMenu("Boş rulo", Resources.EditPageHFLarge);
            menu.AddSubMenu("RFID Dönüş Analizi", newIcon, typeof(DonusAnaliz));
            menu.AddSubMenu("RFID Geri Dönüşleri", listIcon, typeof(ConfExpert.Forms.Depo.DonenRFID.Analiz));
            menu.AddSubMenu("Boş Rulo Listesi", listIcon, typeof(BosRuloGirisleri));
            menu.AddSubMenu("Yeni Giriş", listIcon, typeof(OPonkabul), 'B').SetVisibleFor(25);
            menu.BeginGroup();

            menu = group.AddMenu("İmalat Fazlası", Resources.refresh);
            //menu.AddSubMenu("30 mt.nin altı dönüşler", listIcon, typeof(OPLessThan30)).SetVisibleFor(26);
            menu.AddSubMenu("Son 6 aydaki 30 mt. altı dönüşler", listIcon, typeof(LessThan30)).SetVisibleFor(26);
            menu.AddSubMenu("Bloke çöz", listIcon, typeof(BlokeCoz)).SetVisibleFor(27);
            menu.AddSubMenu("Ön Kabul listesini temizle", listIcon, typeof(OnKabulTemizle)).SetVisibleFor(28);
            menu.AddSubMenu("Ön Kabul", listIcon, typeof(OPonkabul), 'T').SetVisibleFor(29);
            menu.AddSubMenu("RFID/Manuel Giriş Oranları", listIcon, typeof(RFIDManuelOrani));

            menu.AddSubMenu("Henüz Metrajı Ölçülmemiş Toplar", listIcon, typeof(OPOnKabuluYapilmis));
            menu.AddSubMenu("Onayımı Bekleyen Toplar", listIcon, typeof(OPOnayiniziBekleyen));
            menu.AddSubMenu("Tela Topları", listIcon, typeof(OPOnayiniziBekleyen), "Tela").SetVisibleFor(30);  //Miwako+Tülay
            menu.AddSubMenu("Durum Raporu", listIcon, typeof(OPDurumRaporu), false);
            menu.AddSubMenu("GPnin bugüne kadarki girişleri", listIcon, typeof(OPDurumRaporu), true).SetVisibleFor(31);    //GPden sorumlu kullanıcılar

            menu = group.AddMenu("Stok Hareketleri", Resources.BO_Vendor_32x32);
            menu.AddSubMenu("Tümü", listIcon, typeof(Hareket));
            menu.AddSubMenu("Depo Girişleri", listIcon, typeof(DepoGirisRaporu));
            menu.AddSubMenu("Akfil Giren", Resources.navButtonPrev, typeof(AkfilHistory), 'G');
            menu.AddSubMenu("Akfil Çıkan", Resources.navButtonNext, typeof(AkfilHistory), 'Ç');
            menu.AddSubMenu("Kumaş Çıkış Raporu", listIcon, typeof(KumasCikisRaporu));
            menu.AddSubMenu("Çıkılmış Toplar", listIcon, typeof(ConfExpert.Forms.AdhocQuery), AdhocQuery.AdHocQueries.CikilmisToplar);
            menu.AddSubMenu("Tela Çıkışları", listIcon, typeof(ConfExpert.Forms.Depo.TelaCikislari));


            //if (Session.CurrentUser.DepartmentId != 6 /*Departman.KumasDepo*/)
            //    group.AddMenu("Müşteriden gelen artikel girişi", Resources.box1, typeof(StokGirisMusteriden));

            menu = group.AddMenu("Sayım", Resources.BO_Task_32x32);
            menu.BeginGroup();
            menu.AddSubMenu("Yeni Sayım", newIcon, typeof(Sayim));
            menu.AddSubMenu("Sayımlar", newIcon, typeof(Sayimlar));
            menu.AddSubMenu("Top Arama", newIcon, typeof(SayimTop)).SetVisibleFor(32);
            menu.AddSubMenu("Kontrol Listesi", listIcon, typeof(ConfExpert.Forms.Depo.SayimKontrolListesi));

            #endregion

            #region Aksesuar
            page = rm.AddPage(RibbonControl, "Aksesuar");

            group = page.AddGroup("Temel");
            group.AddMenu("Pat Telasi Kesim", Resources.calculator_40, typeof(PatTelasiKesim)).Hide();

            menu = group.AddMenu("Kart İşlemleri", Resources.axes);
            menu.AddSubMenu("Talep", listIcon, typeof(AksesuarKartTalebi));
            menu.AddSubMenu("Onay", listIcon, typeof(AksesuarKartTalepOnaylama)).SetVisibleFor(182);
            menu.AddSubMenu("İşlem Görenler", listIcon, typeof(KartTalebiCevap)).SetVisibleFor(182);

            menu = group.AddMenu("Resimler", Resources.scanner).SetVisibleFor(233);
            menu.AddSubMenu("Çekim", newIcon, typeof(Cekim));
            menu.AddSubMenu(true, "Toplu Gösterim", null, typeof(Resimler));
            menu.AddSubMenu("Son 2 Ayda Tarananlar", null, typeof(YeniTaranan));

            menu = group.AddMenu("Tanımlamalar", Resources.check_book);
            menu.AddSubMenu("Aksesuar Listesi", newIcon, typeof(AksesuarListesi));
            menu.AddSubMenu("Yeni Aksesuar Listesi", newIcon, typeof(Aks1)).SetVisibleFor(17);

            menu.AddSubMenu(true, "Ürün Ağacı", listIcon, typeof(AksesuarUrunAgaci));
            menu.AddSubMenu("Seriler", newIcon, typeof(AksesuarSerileri)).SetVisibleFor(209);
            //menu.AddSubMenu("Seri Analiz", newIcon, typeof(MuhtemelSeriler));

            //menu.AddSubMenu("Düğme", listIcon, typeof(_BedenEtiketleri), 6);
            menu.AddSubMenu("Fazla Alım Oranları", listIcon, typeof(FAO));
            menu.AddSubMenu("Stok Limitleri", listIcon, typeof(AksesuarLimit));

            //TODO K.A : Aşağıdaki iki form kullanılmıyorsa silelim.
            //menu.AddSubMenu(true, "Cari", listIcon, typeof(Repository), "Cari").SetVisibleFor(40);
            //menu.AddSubMenu("Tedarikçiler", listIcon, typeof(AksVendor), "AksVendor").SetVisibleFor(41);
            menu.AddSubMenu(true, "Tedarikçi Mailleri", listIcon, typeof(UreticiMail)).SetVisibleFor(254);
            menu.AddSubMenu("Sevkiyatçılar", listIcon, typeof(Sevkiyatci)).SetVisibleFor(42);
            menu.AddSubMenu(true, "Ürün Kategorileri", listIcon, typeof(Repository), "ProductCategory").SetVisibleFor(43);
            menu.AddSubMenu("Ürün Kaliteleri", listIcon, typeof(Repository), "AksesuarKalite");
            menu.AddSubMenu("Silinen markaların stoku", listIcon, typeof(DeletedBrands));

            group.AddMenu("Stok Durumu", Resources.ParametersLarge, typeof(Stok));

            group.AddMenu("Manuel Stok İşlemleri", Resources.repeat, typeof(Master));

            menu = group.AddMenu("Giriş", Resources.login);
            menu.AddSubMenu("Satınalma-Stok Giriş", newIcon, typeof(ConfExpert.Forms.Depo.Aksesuar.StokGiris)).SetVisibleFor(34);
            menu.AddSubMenu("Satınalma-Fatura Giriş", newIcon, typeof(ConfExpert.Forms.Depo.Aksesuar.FaturaGiris)).SetVisibleFor(35);
            menu.AddSubMenu("Boyamadan Dönen Düğmeler", newIcon, typeof(BoyamaDugmeGirisi)).SetVisibleFor(36);
            menu.AddSubMenu("Giriş Partileri", newIcon, typeof(AksesuarGirisPartileri));
            menu.AddSubMenu("Tarih Aralıklı Liste", newIcon, typeof(AksesuarGC));

            menu = group.AddMenu("Çıkış", Resources.logout);
            menu.AddSubMenu(true, "Çıkış Talepleri", listIcon, typeof(AksesuarCikisTalepleri));
            menu.AddSubMenu("Çıkış Partileri", listIcon, typeof(AksesuarCikisPartileri));
            menu.AddSubMenu("Çıkış İrsaliyeleri", listIcon, typeof(AksesuarCikisIrsaliyeleri));
            menu.AddSubMenu("Açık Aksesuar Çıkışları", listIcon, typeof(AksesuarAcikTalepler));

            menu = group.AddMenu("Ayrım İstekleri", Resources.DateNavigatorModule_Icon);
            menu.AddSubMenu("Aksesuar İsteklerim", listIcon, typeof(AksesuarIstekler), false);
            menu.AddSubMenu("Onayımı Bekleyen Aksesuar İstekleri", listIcon, typeof(AksesuarIstekler), true);
            menu.AddSubMenu("Yoldaki Aksesuardan Ayır", listIcon, typeof(AksPOAyir));


            menu = group.AddMenu("Aksesuar Sayım", Resources.WatermarkLarge2);
            //menu.SetVisibleForUsers(97);      Önder bey
            menu.SetInvisibleForDepartments(Departman.KumasDepo);
            menu.AddSubMenu("Sayım sonuçları", listIcon, typeof(Forms.Depo.Aksesuar.SayimAnaliz3));
            menu.AddSubMenu("Aksesuarların son hareketleri", listIcon, typeof(SonCikisTarihleri));

            group.AddMenu("Atıl Aksesuarlar", Resources.ASPxGridView_EnlargedSmallIcon, typeof(AtilAksesuar));

            menu = group.AddMenu("Bilgi", Resources.axes);
            menu.AddSubMenu("Şüpheli Fiyatlar- Hareket", listIcon, typeof(SupheliFiyatH)).SetVisibleFor(214);
            menu.AddSubMenu("Şüpheli Fiyatlar- Kategori", listIcon, typeof(SupheliFiyatF)).SetVisibleFor(214);

            menu.AddSubMenu(true, "Aksesuar Rapor", listIcon, typeof(AksesuarGiren));
            menu.AddSubMenu("Aksesuar adetleri", listIcon, typeof(Trends));
            menu.AddSubMenu("Aksesuar yaşları", listIcon, typeof(SonHareket));
            menu.AddSubMenu("Aksesuar Sayım", listIcon, typeof(Forms.Depo.Aksesuar.SayimAnaliz2));

            menu.AddSubMenu(true, "Manuel Aksesuar Cikislari", listIcon, typeof(ManuelIslemler), "GetAksesuarManuelCikis", "AksesuarCikisTalebiId").SetVisibleFor(242);
            menu.AddSubMenu(true, "Manuel Aksesuar Satınalma Talepleri", listIcon, typeof(ManuelIslemler), "GetAksesuarManuelPO", "AksPOId").SetVisibleFor(242);


            group.AddMenu("Yıkama Talimatı", Resources.Wash_handwash_small1, typeof(YikamaTalimati), "GetYikamaTalimatlari2");

            group = page.AddGroup("Satınalma");
            group.AddMenu("Talep Listesi", Resources.purchase_order32, typeof(Forms.Depo.Aksesuar.PO)).SetVisibleFor(233);
            group.AddMenu("Satınalma Takip", Resources.AksPOTakip32, typeof(Forms.Depo.Aksesuar.POHistory));
            group.AddMenu("Üreticiye Geçilen Siparişler", Resources.megafone32, typeof(Forms.Depo.Aksesuar.SatinalmaSiparisleri));
            group.AddMenu("Ortak Aksesuarlar", Resources.aks2, typeof(OrtakAksesuarOzet)).SetVisibleFor(196);

            group = page.AddGroup("Pasif Aksesuarlar");
            menu = group.AddMenu("Hareketsiz", Resources.button32);
            menu.AddSubMenu("6 Aydır Hareketsiz Aksesuarlar", listIcon, typeof(HareketsizAksesuar));
            menu.AddSubMenu("Onay Durumları", Resources.Editor_Edit, typeof(PasifOnay));
            menu.AddSubMenu("Ortak Havuz", listIcon, typeof(AksUsable));
            menu.AddSubMenu("Atıl Aksesuar Dönemleri", Resources.Editor_Edit, typeof(AksesuarDonem)).SetVisibleFor(208);



            #endregion

            #region Lojisedarik

            page = rm.AddPage(RibbonControl, "Lojistik");
            group = page.AddGroup("Temel");

            group.AddMenu("Yükleme Formları", Resources.Actions_flag_green_icon, typeof(YuklemeFormlari2)).SetVisibleFor(17);
            //group.AddMenu("Çeki listeleri", Resources.Actions_flag_green_icon, typeof(Ceki), 0).SetVisibleFor(17);

            group.AddMenu("PL Kıran Mağazalar", Resources.Actions_flag_red_icon, typeof(PLKiranMagaza));
            group.AddMenu("Çeki listeleri", Resources._461145912, typeof(YuklenecekGomlekler)).BeginGroup();
            group.AddMenu("Çeki şablonları", Resources.Actions_flag_red_icon, typeof(PLTemplates)).SetVisibleFor(17);

            group.AddMenu("Mağaza Dağılımı Dönüşümleri", Resources.Actions_flag_red_icon, typeof(ParseMagazaDagilimi));

            #endregion

            #region IthalatIhracat
            page = rm.AddPage(RibbonControl, "Dış Ticaret");
            group = page.AddGroup("Temel");

            menu = group.AddMenu("Hesap.Planı", Resources.utilities_stocks, typeof(Repository), "HesapPlani");

            menu = group.AddMenu("Eşlemeler", Resources.utilities_stocks);
            menu.AddSubMenu("UNSPED-NEBİM Şirket eşlemesi", listIcon, typeof(UnspedYurtdisi));
            menu.AddSubMenu("MasrafKalemi HesapPlanı eşlemesi", listIcon, typeof(UnspedMasrafKalemleri));

            group.AddMenu("Banka Hesapları", Resources.Dollar_Sign, typeof(BankaHesaplari));
            group.AddMenu("Firma Bilgileri", Resources.AddressBook_icon, typeof(FirmaBilgileri));

            menu = group.AddMenu("Fatura Yönetimi", Resources.ASPxGridView_EnlargedSmallIcon);
            menu.BeginGroup();





            menu.AddSubMenu("Birleştirilecek Faturalar", newIcon, typeof(MergeAlisFaturasi));
            menu.AddSubMenu("Yeni Fatura", newIcon).AddCustomAction(YeniFaturaAc);

            menu.AddSubMenu("Faturalar", listIcon, typeof(ConfExpert.Forms.SatinAlma.AlisFaturasi));
            //menu.AddSubMenu("Marka kırılımlı liste", listIcon, typeof(ConfExpert.Forms.SatinAlma.ImportList));
            //menu.AddSubMenu("UNSPED.Liste", listIcon, typeof(ConfExpert.Forms.SatinAlma.Unsped));
            menu.AddSubMenu("Barsan WS", listIcon, typeof(Barsan)).Hide();
            menu.AddSubMenu("UNSPED Tablolar", listIcon, typeof(UNSPED_Tables));
            menu.AddSubMenu("İş Takip", listIcon, typeof(IsTakip));

            menu.AddSubMenu(true, "Genel Durum", listIcon, typeof(GenelDurum));
            menu.AddSubMenu("Eşlenmiş Faturalar", listIcon, typeof(EslenmisFaturalar));
            menu.AddSubMenu("Eşlenmemiş Faturalar", listIcon, typeof(Esleme));

            //menu.AddSubMenu(true, "Masraflar. Fatura bazlı", listIcon, typeof(MasrafByFaturaId));
            //menu.AddSubMenu(true, "Masraflar", listIcon, typeof(Masraf)).SetVisibleFor(17);
            menu.AddSubMenu(true, "Dosya Onay", listIcon, typeof(DosyaOnay)).SetVisibleFor(239);
            menu.AddSubMenu("DEKONT Ekleme", listIcon, typeof(EklenecekDekontlar)).SetVisibleFor(239);
            menu.AddSubMenu("Dosya Yükleme", listIcon, typeof(BatchUpload)).SetVisibleFor(239);
            menu.AddSubMenu("Masraflar. Müşteri bazlı", listIcon, typeof(MasrafByMusteri));
            menu.AddSubMenu("Masraf Faturaları", listIcon, typeof(MasrafFaturasi)).SetVisibleFor(227);
            menu.AddSubMenu("Masraflar. CrossCheck", listIcon, typeof(CrossCheck)).SetVisibleFor(17);
            menu.AddSubMenu("Executive Summary", listIcon, typeof(ExecSummary));
            menu.AddSubMenu("UNSPED'e Açılmış Online Çağrılar", listIcon, typeof(UNS_Tickets));

            //menu.AddSubMenu("Ana liste", newIcon, typeof(ConfExpert.Forms.SatinAlma.AlisFaturasi));
            //menu.AddSubMenu("Marka kırılımı", listIcon, typeof(ConfExpert.Forms.SatinAlma.ImportList));
            //menu.AddSubMenu(true, "UNSPED.Liste", listIcon, typeof(ConfExpert.Forms.SatinAlma.Unsped));

            #endregion

            #region Finans

            page = rm.AddPage(RibbonControl, "Finans");
            group = page.AddGroup("Talepler");

            group.AddMenu("Akreditifli Proforma", Resources.email32x32_24_bit, typeof(Forms.Finans.AkreditifliProforma)).Hide();

            menu = group.AddMenu("Kargo Gönderileri", Resources.DXR__2_);
            menu.AddSubMenu("DHL", listIcon, typeof(DHLWS)).Hide();
            menu.AddSubMenu(true, "DHL Raporu Aktar", listIcon, typeof(KargoFatura_DHL)).SetVisibleFor(44);
            menu.AddSubMenu("Excel Raporu Aktar", listIcon, typeof(KargoFatura)).SetVisibleFor(44);
            menu.AddSubMenu("Mikro İhracat Gönderisi", listIcon, typeof(KargoEkle), 1);
            menu.AddSubMenu("Proformalı Gönderi", listIcon, typeof(KargoEkle), 2);
            menu.AddSubMenu("Fatura Gir", listIcon, typeof(FaturaGir));
            menu.AddSubMenu(true, "Müşteri bazlı Masraf Dağılımı", listIcon, typeof(KargoMasrafByMusteri));
            menu.AddSubMenu("Eşleşmeyenler", listIcon, typeof(KargoEslesme));
            menu.AddSubMenu("Eşleşmeyenler by ShipmentDate", listIcon, typeof(KargoEslemeByTarih));
            menu.AddSubMenu(true, "Kargo Ücreti Hesapla", listIcon, typeof(KargoKoli));
            menu.AddSubMenu("Kargo Tarifeleri", listIcon, typeof(KargoKoli)).SetVisibleFor(17);    //TODO: devam edilecek
            menu.AddSubMenu("Kargo Zone", listIcon, typeof(KargoZone));

            #endregion

            #region InsanKaynakları

            page = rm.AddPage(RibbonControl, "İnsan Kaynakları");
            group = page.AddGroup("Temel");
            group.AddMenu("Personel", Resources.BO_Contact_Large, typeof(Employees)).SetVisibleFor(192);
            group.AddMenu("Personel Foto", Resources.BO_Contact_Large, typeof(UsersPhoto)).SetVisibleFor(17);
            group.AddMenu("Personel Foto Yükleme", Resources.BO_Contact_Large, typeof(BatchUploadPhoto)).SetVisibleFor(17);
            group.AddMenu("Personel Devam Kontrol Sistemi", Resources.Reporting_GroupType_Icon, typeof(PDKSYeni)).SetVisibleFor(50);
            group.AddMenu("Çalışma Saatleri", Resources.Reporting_GroupType_Icon, typeof(PDKSCalismaSaatleri)).SetVisibleFor(50);
            group.AddMenu("İzinler", Resources.HolidaysModule_Icon, typeof(Izinler)).SetVisibleFor(50);
            group.AddMenu("İzinler - Yeni", Resources.HolidaysModule_Icon, typeof(IzinYonetimi)).SetVisibleFor(50);
            group.AddMenu("Tatiller", Resources.HolidaysModule_Icon, typeof(Tatiller)).SetVisibleFor(50);
            group.AddMenu("Yeni Kartlar", Resources.HolidaysModule_Icon, typeof(YeniKartlar)).SetVisibleFor(50).BeginGroup();

            #endregion

            #region Sistem

            page = rm.AddPage(RibbonControl, "Sistem");
            group = page.AddGroup("Varlıklar");

            //group.AddMenu("TableScope", Resources.right, typeof(Scope)).SetVisibleFor(17);
            menu = group.AddMenu("Templates", Resources.report).Hide();
            //menu.AddSubMenu("Çeki Listesi", newIcon, typeof(Templates), "CekiListesi");
            menu.AddSubMenu("Masraf Faturası", newIcon, typeof(Templates), "MasrafFaturasi");
            menu.AddSubMenu("Profil", newIcon, typeof(Templates), "Profil");
            menu.AddSubMenu(true, "Diğer", newIcon, typeof(Templates), "Diger");

            group.AddMenu("Generic Reports", Resources.report, typeof(GenericReports));  //.SetVisibleFor(17);
            group.AddMenu("Yetki", Resources.Highlight_32x32, typeof(Yetki)).SetVisibleFor(17);
            group.AddMenu("Lookup Map", Resources.refresh_241, typeof(LookupMap)).Hide();
            group.AddMenu("Excel View", Resources.Highlight_32x32, typeof(ExcelView)).Hide();
            group.AddMenu("Temel Tablolar", Resources.Highlight_32x32, typeof(Repository)).Hide();
            //group.AddMenu("Özellikler", Resources.iMac, typeof(Lookups)).Hide();

            //menu = group.AddMenu("Üreticiler", Resources.factory, typeof(Vendor));
            //menu.SetVisibleForUsers(TeamLeaders);
            //menu.BeginGroup();

            //group.AddMenu("Müşteriler ve Markalar", Resources.BO_Customer_Large, typeof(Customers)).SetVisibleForUsers(TeamLeaders);
            //group.AddMenu("Atölyeler", Resources.Devices_media_flash_sd_mmc_icon, typeof(Repository), "Atelye").SetVisibleForUsers(TeamLeaders);


            menu = group.AddMenu("Kısaltmalar", Resources.Devices_media_flash_sd_mmc_icon);
            menu.BeginGroup();
            menu.AddSubMenu("Üretici", newIcon, typeof(Kisaltmalar), "Vendor");
            menu.AddSubMenu("Marka", newIcon, typeof(Kisaltmalar), "Brand").SetVisibleFor(45);

            //group.AddMenu("Cari Kartlar", Resources.XtraVerticalGrid_EnlargedSmallIcon, typeof(Repository), "Cari").SetVisibleForUsers(TeamLeaders);
            group.AddMenu("Cari Kartlar", Resources.XtraVerticalGrid_EnlargedSmallIcon, typeof(ConfExpert.Forms.Sistem.Cari)).Hide();
            group.AddMenu("Üretici", Resources.XtraVerticalGrid_EnlargedSmallIcon, typeof(Vendor)).SetVisibleFor(46);

            menu.BeginGroup();

            //group.AddMenu("Roller ve Yetkiler", Resources.BO_User_Large, typeof(Yetki)).Hide();

            //group = page.AddGroup("Customization");
            //group.AddMenu("Forms", Resources.down, typeof(ConfExpert.Forms.Sistem.Forms)).Hide();
            //group.AddMenu("Grids", Resources.axes, typeof(CustomizeGrids)).Hide();
            //group.AddMenu("Lookups", Resources.BO_User_Large, typeof(CustomizeLookUps)).Hide();

            group = page.AddGroup("Helpers");
            //group.AddMenu("Generate Data", new Bitmap(listIcon), typeof(TestWithData)).Hide();
            //group.AddMenu("Exceptions", new Bitmap(listIcon), typeof(Exceptions)).Hide();
            //menu = group.AddMenu("Non-classified", new Bitmap(listIcon));
            //menu.SetVisibleForUsers(Admins);
            //menu.AddSubMenu("Read Fabric Scans", new Bitmap(listIcon), typeof(Fabrics));
            //TODO menu.AddSubMenu("GDI+", new Bitmap(listIcon), typeof());

            group.AddMenu("Usage Graph", Resources.Caramel___48x48, typeof(WhosOnline), 1).Hide();
            group.AddMenu("Usage Graph ConfOrder", Resources.Caramel___48x48, typeof(WhosOnline), 2).Hide();
            group.AddMenu("Online Users", Resources.SNP_2696434_en_v1, typeof(OnlineUsers)).Hide();
            group.AddMenu("Screenshots", Resources.Computer_On, typeof(Screenshots)).Hide();

            #endregion

            #region Yardım

            /*
            #region Yardım
            page = AddPage(RibbonControl, "Yardım");
            group = page.AddGroup("Yardım");

            menu = group.AddMenu("Versiyon Geçmişi", Resources.CustomDraw_Icon, typeof(VersiyonGecmis));
            //menu = group.AddMenu("Yardım", Resources.support_icon, typeof());
            #endregion
            */

            #endregion

            #region Destex

            page = rm.AddPage(RibbonControl, "Destex").SetVisibleFor(207);


            group = page.AddGroup("Satış işlemleri");

            group.AddMenu("Yeni Sipariş", (Bitmap)newIcon, typeof(YeniSatis));
            group.AddMenu("Sipariş Yönetimi", Resources._1338456118_Cut, typeof(SiparisYonetimi));
            group.AddMenu("Kesilen Siparişler", Resources.ChangePalettePlaceHolder_32x32, typeof(KesilenSiparisler));
            group.AddMenu("Faturalar", (Bitmap)listIcon, typeof(Faturalar));
            group.AddMenu("Müşteriler", Resources.BO_Customer_Large, typeof(Musteriler));

            //TODO: Aşağıdaki formlar üzerinde tekrar çalışmak gerek. Şuan kullanılabilecek durumda değiller.
            //menu.AddSubMenu(true, "Ödemeler", listIcon, typeof(Odemeler)).Hide();
            //menu.AddSubMenu(true, "Cari Hesap", newIcon, typeof(Forms.Destex.Satis.CariHesap)).Hide();

            group = page.AddGroup("Araçlar");
            group.AddMenu("Stok Kartları", Resources.legend, typeof(StokKarti), false);
            group.AddMenu("Numune Top Girişi", Resources.box1, typeof(NumuneTopGirisi));
            group.AddMenu("Top Etiketleme", Resources.CustomDraw_Icon, typeof(TopEtiketleme)).BeginGroup();
            group.AddMenu("Top Tarama", Resources.scanner, typeof(TopTarama));
            group.AddMenu("Stok Durumu", Resources.ParametersLarge, typeof(Forms.Destex.StokDurumu));
            group.AddMenu("FourSeason Liste", Resources.coffee_cup, typeof(EspressoList), true);
            group.AddMenu("Destex'e Geçilen Siparişler", Resources.shopping_cart_accept, typeof(SO));

            menu = group.AddMenu("Fiyatlandırma", Resources.euro_currency_sign);
            menu.AddSubMenu("ESP Artikellerinin Satış Fiyatları", newIcon, typeof(ESPSatisFiyat));
            menu.AddSubMenu("Kumaş Fiyatları", newIcon, typeof(FiyatKumas));
            menu.AddSubMenu("Kalite Fiyatları", newIcon, typeof(FiyatKalite));
            menu.AddSubMenu(true, "Kontrol Edilecek Monti Kaliteleri", newIcon, typeof(Kaliteler));
            menu.AddSubMenu("Fiyat Listelerinde Geçmeyen Kumaşlar", newIcon, typeof(KalitesiEslesmeyen));

            menu.AddSubMenu("Karbel->Destex Satış Fiyatları", listIcon, typeof(KumasSatisFiyat)).SetVisibleFor(240);
            #endregion

            #region Du4Kesim

            page = rm.AddPage(RibbonControl, "Du4 Kesim");
            group = page.AddGroup("Du4 Kesimhane");

            menu = group.AddMenu("Kesim", Resources._1338456121_Cut, typeof(Du4KesimV3));
            menu = group.AddMenu("Kesim Geçmişi", Resources.KesimGecmisi, typeof(KesimGecmisi));
            menu = group.AddMenu("Dosya Bazında Kesim Adetleri", Resources.report, typeof(AdhocQuery), AdhocQuery.AdHocQueries.Du4DosyaBazindaKesimAdetleri);

            menu = group.AddMenu("Kumaşlar", Resources.legend, typeof(Du4Articles));
            menu.BeginGroup();

            menu = group.AddMenu("Toplar", Resources.Roll, typeof(AdhocQuery), AdhocQuery.AdHocQueries.Du4DepodakiToplar);
            menu = group.AddMenu("Stok Durumu", Resources.utilities_stocks, typeof(Forms.Du4.StokDurumu));
            menu = group.AddMenu("Rafa Yerleştirme", Resources.tag_label, typeof(Yerlestirme));

            menu = group.AddMenu("Eski Kesimler", Resources._1338456329_shine_14, typeof(AdhocQuery), AdhocQuery.AdHocQueries.Du4EskiKesim);

            menu = group.AddMenu("Çıkış", Resources.shut_down_32);
            menu.AddCustomAction(AppSession.MainForm.Cikis);
            menu.BeginGroup();
            #endregion

            foreach (RibbonPage ribbonPage in RibbonControl.Pages)
            {
                foreach (RibbonPageGroup ribbonGroup in ribbonPage.Groups)
                {
                    ribbonGroup.Visible = false;
                    foreach (object ribbonMenu in ribbonGroup.ItemLinks)
                    {
                        if (ribbonMenu is BarButtonItemLink)
                            if (((BarButtonItemLink)ribbonMenu).Visible)
                            {
                                ribbonGroup.Visible = true;
                                break;
                            }
                    }
                }

                if (ribbonPage.Visible)
                {
                    ribbonPage.Visible = false;
                    foreach (RibbonPageGroup ribbonGroup in ribbonPage.Groups)
                    {
                        if (ribbonGroup.Visible)
                        {
                            ribbonPage.Visible = true;
                            break;
                        }
                    }
                }
            }


            if (Session.WhoAmI != 100)
            {
                if (RibbonControl.Pages["DU4 KESİM"] != null)
                    RibbonControl.Pages["DU4 KESİM"].Visible = Session.CurrentUser.AmI(53, 265);
            }
            else
                RibbonControl.Pages["DU4 KESİM"].Visible = true;
            // ribbonControl.SelectedPage = ribbonControl.Pages["Satınalma"];

            RibbonControl.ForceInitialize();
        }

        //private static void POBaseAc()
        //{
        //    POBase poBase = new POBase(-1, false);
        //    poBase.Show();
        //}

        static void RibbonManager_MenuClicked(Type type, params object[] parameters)
        {
            AppSession.MainForm.ShowMdiChildForm(type, parameters);
        }

        private static void YeniFaturaAc()
        {
            using (YeniFatura yf = new YeniFatura())
                yf.ShowDialog();
        }

        private static void OwnerDegistir()
        {
            using (OwnerDegistir od = new OwnerDegistir())
                od.ShowDialog();
        }

        private static void YeniPO()
        {
            using (YeniPO yf = new YeniPO())
                yf.ShowDialog();
        }

        public static void DownloadESPYikamaTalimatlari()
        {
            byte[] content = Session.DataManager.ExecuteDataTable("GetDoc", 3056).Rows[0]["BLOB"] as byte[];
            FileManager.RunTempFile("ESP INDIGO YIKAMA TALİMATLARI.xlsx", content);
        }

        public static void DownloadYikamaTalimatlari()
        {
            byte[] content = Session.DataManager.ExecuteDataTable("GetDoc", 3219).Rows[0]["BLOB"] as byte[];
            FileManager.RunTempFile("YIKAMA TALİMATLARI.pdf", content);
        }

        public static void Raporlar()
        {
            AppSession.MainForm.ShowDockPanel("Raporlar");
        }

        public static void SezonBazli()
        {
            AppSession.MainForm.ShowDockPanel("Sezon Bazlı İşlemler");
        }

        public static void MusteriBazli()
        {
            AppSession.MainForm.ShowDockPanel("Müşteri Bazlı İşlemler");
        }

        public static void DownloadAnlatim()
        {
            DataRow r = Session.DataManager.ExecuteDataTable("GetTemplates", "Diger", 1).Rows[0];
            FileManager.RunTempFile(r["DosyaAdi"].ToStr(), r["BLOB"] as byte[]);
        }

        public static void DownloadFiyatListesi()
        {
            DataRow r = Session.DataManager.ExecuteDataTable("GetTemplates", "Diger", 2).Rows[0];
            FileManager.RunTempFile(r["DosyaAdi"].ToStr(), r["BLOB"] as byte[]);
        }

        public static void DownloadYikamaReceteleri()
        {
            DataRow r = Session.DataManager.ExecuteDataTable("GetTemplates", "Diger", 3).Rows[0];
            FileManager.RunTempFile(r["DosyaAdi"].ToStr(), r["BLOB"] as byte[]);
        }

    }
}